/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    ap-northeast-2-pop = 'aas.ap-northeast-1.aliyuncs.com',
    cn-beijing-finance-1 = 'aas.aliyuncs.com',
    cn-beijing-finance-pop = 'aas.aliyuncs.com',
    cn-beijing-gov-1 = 'aas.aliyuncs.com',
    cn-beijing-nu16-b01 = 'aas.aliyuncs.com',
    cn-chengdu = 'aas.aliyuncs.com',
    cn-edge-1 = 'aas.aliyuncs.com',
    cn-fujian = 'aas.aliyuncs.com',
    cn-haidian-cm12-c01 = 'aas.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'aas.aliyuncs.com',
    cn-hangzhou-finance = 'aas.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'aas.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'aas.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'aas.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'aas.aliyuncs.com',
    cn-hangzhou-test-306 = 'aas.aliyuncs.com',
    cn-hongkong-finance-pop = 'aas.aliyuncs.com',
    cn-huhehaote = 'aas.aliyuncs.com',
    cn-north-2-gov-1 = 'aas.aliyuncs.com',
    cn-qingdao-nebula = 'aas.aliyuncs.com',
    cn-shanghai = 'aas-vpc.cn-shanghai.aliyuncs.com',
    cn-shanghai-et15-b01 = 'aas.aliyuncs.com',
    cn-shanghai-et2-b01 = 'aas.aliyuncs.com',
    cn-shanghai-finance-1 = 'aas.aliyuncs.com',
    cn-shanghai-inner = 'aas.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'aas.aliyuncs.com',
    cn-shenzhen = 'aas.aliyuncs.com',
    cn-shenzhen-finance-1 = 'aas.aliyuncs.com',
    cn-shenzhen-inner = 'aas.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'aas.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'aas.aliyuncs.com',
    cn-wuhan = 'aas.aliyuncs.com',
    cn-yushanfang = 'aas.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'aas.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'aas.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'aas.aliyuncs.com',
    eu-west-1-oxs = 'aas.ap-northeast-1.aliyuncs.com',
    rus-west-1-pop = 'aas.ap-northeast-1.aliyuncs.com',
    us-east-1 = 'aas.ap-northeast-1.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('aas', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ChangePreferredLanguageRequest {
  preferredLanguage?: string(name='PreferredLanguage'),
}

model ChangePreferredLanguageResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ChangePreferredLanguageResponse = {
  headers: map[string]string(name='headers'),
  body: ChangePreferredLanguageResponseBody(name='body'),
}

async function changePreferredLanguageWithOptions(request: ChangePreferredLanguageRequest, runtime: Util.RuntimeOptions): ChangePreferredLanguageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.preferredLanguage)) {
    query['PreferredLanguage'] = request.preferredLanguage;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangePreferredLanguage',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function changePreferredLanguage(request: ChangePreferredLanguageRequest): ChangePreferredLanguageResponse {
  var runtime = new Util.RuntimeOptions{};
  return changePreferredLanguageWithOptions(request, runtime);
}

model CheckMfaBindResponseBody = {
  code?: int32(name='Code'),
  isBindMfa?: boolean(name='IsBindMfa'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CheckMfaBindResponse = {
  headers: map[string]string(name='headers'),
  body: CheckMfaBindResponseBody(name='body'),
}

async function checkMfaBindWithOptions(runtime: Util.RuntimeOptions): CheckMfaBindResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'CheckMfaBind',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkMfaBind(): CheckMfaBindResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkMfaBindWithOptions(runtime);
}

model CreateAccessKeyForAccountRequest {
  AKSecret?: string(name='AKSecret'),
  PK?: string(name='PK'),
}

model CreateAccessKeyForAccountResponseBody = {
  accessKey?: {
    accessKeyId?: string(name='AccessKeyId'),
    accessKeySecret?: string(name='AccessKeySecret'),
    accessKeyStatus?: string(name='AccessKeyStatus'),
    accessKeyType?: string(name='AccessKeyType'),
    createTime?: string(name='CreateTime'),
  }(name='AccessKey'),
  PK?: string(name='PK'),
  requestId?: string(name='RequestId'),
}

model CreateAccessKeyForAccountResponse = {
  headers: map[string]string(name='headers'),
  body: CreateAccessKeyForAccountResponseBody(name='body'),
}

async function createAccessKeyForAccountWithOptions(request: CreateAccessKeyForAccountRequest, runtime: Util.RuntimeOptions): CreateAccessKeyForAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.AKSecret)) {
    query['AKSecret'] = request.AKSecret;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAccessKeyForAccount',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAccessKeyForAccount(request: CreateAccessKeyForAccountRequest): CreateAccessKeyForAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAccessKeyForAccountWithOptions(request, runtime);
}

model CreateAliyunAccountRequest {
  aliyunId?: string(name='AliyunId'),
}

model CreateAliyunAccountResponseBody = {
  aliyunId?: string(name='AliyunId'),
  PK?: string(name='PK'),
  requestId?: string(name='RequestId'),
}

model CreateAliyunAccountResponse = {
  headers: map[string]string(name='headers'),
  body: CreateAliyunAccountResponseBody(name='body'),
}

async function createAliyunAccountWithOptions(request: CreateAliyunAccountRequest, runtime: Util.RuntimeOptions): CreateAliyunAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunId)) {
    query['AliyunId'] = request.aliyunId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAliyunAccount',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAliyunAccount(request: CreateAliyunAccountRequest): CreateAliyunAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAliyunAccountWithOptions(request, runtime);
}

model CreateAliyunAccountWithBindHidRequest {
  innerAccountHid?: string(name='InnerAccountHid'),
}

model CreateAliyunAccountWithBindHidResponseBody = {
  PK?: string(name='PK'),
  requestId?: string(name='RequestId'),
}

model CreateAliyunAccountWithBindHidResponse = {
  headers: map[string]string(name='headers'),
  body: CreateAliyunAccountWithBindHidResponseBody(name='body'),
}

async function createAliyunAccountWithBindHidWithOptions(request: CreateAliyunAccountWithBindHidRequest, runtime: Util.RuntimeOptions): CreateAliyunAccountWithBindHidResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.innerAccountHid)) {
    query['InnerAccountHid'] = request.innerAccountHid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAliyunAccountWithBindHid',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAliyunAccountWithBindHid(request: CreateAliyunAccountWithBindHidRequest): CreateAliyunAccountWithBindHidResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAliyunAccountWithBindHidWithOptions(request, runtime);
}

model CreateIntlAliyunAccountRequest {
  nationalityCode?: string(name='NationalityCode'),
}

model CreateIntlAliyunAccountResponseBody = {
  PK?: string(name='PK'),
  requestId?: string(name='RequestId'),
}

model CreateIntlAliyunAccountResponse = {
  headers: map[string]string(name='headers'),
  body: CreateIntlAliyunAccountResponseBody(name='body'),
}

async function createIntlAliyunAccountWithOptions(request: CreateIntlAliyunAccountRequest, runtime: Util.RuntimeOptions): CreateIntlAliyunAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.nationalityCode)) {
    query['NationalityCode'] = request.nationalityCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIntlAliyunAccount',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createIntlAliyunAccount(request: CreateIntlAliyunAccountRequest): CreateIntlAliyunAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIntlAliyunAccountWithOptions(request, runtime);
}

model CreateShortTermAccessKeyForAccountRequest {
  expireTime?: string(name='ExpireTime'),
  isMfaPresent?: boolean(name='IsMfaPresent'),
  PK?: string(name='PK'),
}

model CreateShortTermAccessKeyForAccountResponseBody = {
  accessKey?: {
    accessKeyId?: string(name='AccessKeyId'),
    accessKeySecret?: string(name='AccessKeySecret'),
    accessKeyStatus?: string(name='AccessKeyStatus'),
    accessKeyType?: string(name='AccessKeyType'),
    createTime?: string(name='CreateTime'),
    expireTime?: string(name='ExpireTime'),
  }(name='AccessKey'),
  PK?: string(name='PK'),
  requestId?: string(name='RequestId'),
}

model CreateShortTermAccessKeyForAccountResponse = {
  headers: map[string]string(name='headers'),
  body: CreateShortTermAccessKeyForAccountResponseBody(name='body'),
}

async function createShortTermAccessKeyForAccountWithOptions(request: CreateShortTermAccessKeyForAccountRequest, runtime: Util.RuntimeOptions): CreateShortTermAccessKeyForAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.expireTime)) {
    query['ExpireTime'] = request.expireTime;
  }
  if (!Util.isUnset(request.isMfaPresent)) {
    query['IsMfaPresent'] = request.isMfaPresent;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateShortTermAccessKeyForAccount',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createShortTermAccessKeyForAccount(request: CreateShortTermAccessKeyForAccountRequest): CreateShortTermAccessKeyForAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return createShortTermAccessKeyForAccountWithOptions(request, runtime);
}

model DeleteAccessKeyForAccountRequest {
  AKId?: string(name='AKId'),
  PK?: string(name='PK'),
}

model DeleteAccessKeyForAccountResponseBody = {
  PK?: string(name='PK'),
  requestId?: string(name='RequestId'),
  result?: string(name='Result'),
}

model DeleteAccessKeyForAccountResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteAccessKeyForAccountResponseBody(name='body'),
}

async function deleteAccessKeyForAccountWithOptions(request: DeleteAccessKeyForAccountRequest, runtime: Util.RuntimeOptions): DeleteAccessKeyForAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.AKId)) {
    query['AKId'] = request.AKId;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAccessKeyForAccount',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAccessKeyForAccount(request: DeleteAccessKeyForAccountRequest): DeleteAccessKeyForAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAccessKeyForAccountWithOptions(request, runtime);
}

model GenerateAccountLoginTokenRequest {
  targetPk?: string(name='TargetPk'),
}

model GenerateAccountLoginTokenResponseBody = {
  loginToken?: {
    loginTokenString?: string(name='LoginTokenString'),
    targetPk?: string(name='TargetPk'),
  }(name='LoginToken'),
  requestId?: string(name='RequestId'),
}

model GenerateAccountLoginTokenResponse = {
  headers: map[string]string(name='headers'),
  body: GenerateAccountLoginTokenResponseBody(name='body'),
}

async function generateAccountLoginTokenWithOptions(request: GenerateAccountLoginTokenRequest, runtime: Util.RuntimeOptions): GenerateAccountLoginTokenResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.targetPk)) {
    query['TargetPk'] = request.targetPk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GenerateAccountLoginToken',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function generateAccountLoginToken(request: GenerateAccountLoginTokenRequest): GenerateAccountLoginTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateAccountLoginTokenWithOptions(request, runtime);
}

model GenerateAliyunBidCertWaysUrlRequest {
  aliyunPk?: string(name='AliyunPk', description='aliyunPk'),
  bidType?: string(name='BidType', description='bidType'),
  isMobile?: boolean(name='IsMobile', description='isMobile'),
  isOpenApp?: boolean(name='IsOpenApp', description='isOpenApp'),
  platform?: string(name='Platform', description='platform'),
  requestId?: string(name='RequestId', description='requestId'),
  source?: string(name='Source', description='source'),
  subjectType?: string(name='SubjectType', description='subjectType'),
}

model GenerateAliyunBidCertWaysUrlResponseBody = {
  code?: string(name='Code', description='code'),
  data?: string(name='Data', description='data'),
  httpCode?: string(name='HttpCode', description='httpCode'),
  message?: string(name='Message', description='message'),
  requestId?: string(name='RequestId', description='requestId'),
  success?: boolean(name='Success', description='success'),
}

model GenerateAliyunBidCertWaysUrlResponse = {
  headers: map[string]string(name='headers'),
  body: GenerateAliyunBidCertWaysUrlResponseBody(name='body'),
}

async function generateAliyunBidCertWaysUrlWithOptions(request: GenerateAliyunBidCertWaysUrlRequest, runtime: Util.RuntimeOptions): GenerateAliyunBidCertWaysUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunPk)) {
    query['AliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.bidType)) {
    query['BidType'] = request.bidType;
  }
  if (!Util.isUnset(request.isMobile)) {
    query['IsMobile'] = request.isMobile;
  }
  if (!Util.isUnset(request.isOpenApp)) {
    query['IsOpenApp'] = request.isOpenApp;
  }
  if (!Util.isUnset(request.platform)) {
    query['Platform'] = request.platform;
  }
  if (!Util.isUnset(request.requestId)) {
    query['RequestId'] = request.requestId;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.subjectType)) {
    query['SubjectType'] = request.subjectType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GenerateAliyunBidCertWaysUrl',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function generateAliyunBidCertWaysUrl(request: GenerateAliyunBidCertWaysUrlRequest): GenerateAliyunBidCertWaysUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateAliyunBidCertWaysUrlWithOptions(request, runtime);
}

model GetAliyunAccountWithBindHidRequest {
  innerAccountHid?: string(name='InnerAccountHid'),
}

model GetAliyunAccountWithBindHidResponseBody = {
  PK?: string(name='PK'),
  requestId?: string(name='RequestId'),
}

model GetAliyunAccountWithBindHidResponse = {
  headers: map[string]string(name='headers'),
  body: GetAliyunAccountWithBindHidResponseBody(name='body'),
}

async function getAliyunAccountWithBindHidWithOptions(request: GetAliyunAccountWithBindHidRequest, runtime: Util.RuntimeOptions): GetAliyunAccountWithBindHidResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.innerAccountHid)) {
    query['InnerAccountHid'] = request.innerAccountHid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAliyunAccountWithBindHid',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAliyunAccountWithBindHid(request: GetAliyunAccountWithBindHidRequest): GetAliyunAccountWithBindHidResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAliyunAccountWithBindHidWithOptions(request, runtime);
}

model GetAliyunAccountWithBindTaobaoHidRequest {
  havanaId?: string(name='HavanaId'),
}

model GetAliyunAccountWithBindTaobaoHidResponseBody = {
  PK?: string(name='PK'),
  partnerPk?: string(name='PartnerPk'),
  requestId?: string(name='RequestId'),
}

model GetAliyunAccountWithBindTaobaoHidResponse = {
  headers: map[string]string(name='headers'),
  body: GetAliyunAccountWithBindTaobaoHidResponseBody(name='body'),
}

async function getAliyunAccountWithBindTaobaoHidWithOptions(request: GetAliyunAccountWithBindTaobaoHidRequest, runtime: Util.RuntimeOptions): GetAliyunAccountWithBindTaobaoHidResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.havanaId)) {
    query['HavanaId'] = request.havanaId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAliyunAccountWithBindTaobaoHid',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAliyunAccountWithBindTaobaoHid(request: GetAliyunAccountWithBindTaobaoHidRequest): GetAliyunAccountWithBindTaobaoHidResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAliyunAccountWithBindTaobaoHidWithOptions(request, runtime);
}

model GetBasicInfoForAccountRequest {
  aliyunId?: string(name='AliyunId'),
}

model GetBasicInfoForAccountResponseBody = {
  accountStatus?: string(name='AccountStatus'),
  lastLoginDate?: string(name='LastLoginDate'),
  PK?: string(name='PK'),
  requestId?: string(name='RequestId'),
}

model GetBasicInfoForAccountResponse = {
  headers: map[string]string(name='headers'),
  body: GetBasicInfoForAccountResponseBody(name='body'),
}

async function getBasicInfoForAccountWithOptions(request: GetBasicInfoForAccountRequest, runtime: Util.RuntimeOptions): GetBasicInfoForAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunId)) {
    query['AliyunId'] = request.aliyunId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBasicInfoForAccount',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getBasicInfoForAccount(request: GetBasicInfoForAccountRequest): GetBasicInfoForAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBasicInfoForAccountWithOptions(request, runtime);
}

model GetShortTermAccessKeyForAccountRequest {
  expireTime?: string(name='ExpireTime'),
  isMfaPresent?: boolean(name='IsMfaPresent'),
  PK?: string(name='PK'),
}

model GetShortTermAccessKeyForAccountResponseBody = {
  accessKey?: {
    accessKeyId?: string(name='AccessKeyId'),
    accessKeySecret?: string(name='AccessKeySecret'),
    accessKeyStatus?: string(name='AccessKeyStatus'),
    accessKeyType?: string(name='AccessKeyType'),
    createTime?: string(name='CreateTime'),
    expireTime?: string(name='ExpireTime'),
  }(name='AccessKey'),
  PK?: string(name='PK'),
  requestId?: string(name='RequestId'),
}

model GetShortTermAccessKeyForAccountResponse = {
  headers: map[string]string(name='headers'),
  body: GetShortTermAccessKeyForAccountResponseBody(name='body'),
}

async function getShortTermAccessKeyForAccountWithOptions(request: GetShortTermAccessKeyForAccountRequest, runtime: Util.RuntimeOptions): GetShortTermAccessKeyForAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.expireTime)) {
    query['ExpireTime'] = request.expireTime;
  }
  if (!Util.isUnset(request.isMfaPresent)) {
    query['IsMfaPresent'] = request.isMfaPresent;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetShortTermAccessKeyForAccount',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getShortTermAccessKeyForAccount(request: GetShortTermAccessKeyForAccountRequest): GetShortTermAccessKeyForAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return getShortTermAccessKeyForAccountWithOptions(request, runtime);
}

model ListAccessKeysForAccountRequest {
  AKStatus?: string(name='AKStatus'),
  AKType?: string(name='AKType'),
  PK?: string(name='PK'),
}

model ListAccessKeysForAccountResponseBody = {
  accessKeys?: {
    accessKey?: [ 
    {
      accessKeyId?: string(name='AccessKeyId'),
      accessKeySecret?: string(name='AccessKeySecret'),
      accessKeyStatus?: string(name='AccessKeyStatus'),
      accessKeyType?: string(name='AccessKeyType'),
      createTime?: string(name='CreateTime'),
    }
  ](name='AccessKey')
  }(name='AccessKeys'),
  PK?: string(name='PK'),
  requestId?: string(name='RequestId'),
}

model ListAccessKeysForAccountResponse = {
  headers: map[string]string(name='headers'),
  body: ListAccessKeysForAccountResponseBody(name='body'),
}

async function listAccessKeysForAccountWithOptions(request: ListAccessKeysForAccountRequest, runtime: Util.RuntimeOptions): ListAccessKeysForAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.AKStatus)) {
    query['AKStatus'] = request.AKStatus;
  }
  if (!Util.isUnset(request.AKType)) {
    query['AKType'] = request.AKType;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAccessKeysForAccount',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAccessKeysForAccount(request: ListAccessKeysForAccountRequest): ListAccessKeysForAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAccessKeysForAccountWithOptions(request, runtime);
}

model ListAliyunAccountRequest {
  marker?: string(name='Marker'),
  maxItems?: int32(name='MaxItems'),
}

model ListAliyunAccountResponseBody = {
  accounts?: {
    account?: [ 
    {
      accountStatus?: string(name='AccountStatus'),
      aliyunId?: string(name='AliyunId'),
      lastLoginDate?: string(name='LastLoginDate'),
      PK?: string(name='PK'),
    }
  ](name='Account')
  }(name='Accounts'),
  hasNext?: boolean(name='HasNext'),
  isTruncated?: boolean(name='IsTruncated'),
  marker?: string(name='Marker'),
  requestId?: string(name='RequestId'),
  totalAccount?: int32(name='TotalAccount'),
}

model ListAliyunAccountResponse = {
  headers: map[string]string(name='headers'),
  body: ListAliyunAccountResponseBody(name='body'),
}

async function listAliyunAccountWithOptions(request: ListAliyunAccountRequest, runtime: Util.RuntimeOptions): ListAliyunAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.marker)) {
    query['Marker'] = request.marker;
  }
  if (!Util.isUnset(request.maxItems)) {
    query['MaxItems'] = request.maxItems;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAliyunAccount',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAliyunAccount(request: ListAliyunAccountRequest): ListAliyunAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAliyunAccountWithOptions(request, runtime);
}

model UpdateAccessKeyStatusForAccountRequest {
  AKId?: string(name='AKId'),
  AKStatus?: string(name='AKStatus'),
  PK?: string(name='PK'),
}

model UpdateAccessKeyStatusForAccountResponseBody = {
  PK?: string(name='PK'),
  requestId?: string(name='RequestId'),
  result?: string(name='Result'),
}

model UpdateAccessKeyStatusForAccountResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateAccessKeyStatusForAccountResponseBody(name='body'),
}

async function updateAccessKeyStatusForAccountWithOptions(request: UpdateAccessKeyStatusForAccountRequest, runtime: Util.RuntimeOptions): UpdateAccessKeyStatusForAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.AKId)) {
    query['AKId'] = request.AKId;
  }
  if (!Util.isUnset(request.AKStatus)) {
    query['AKStatus'] = request.AKStatus;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAccessKeyStatusForAccount',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateAccessKeyStatusForAccount(request: UpdateAccessKeyStatusForAccountRequest): UpdateAccessKeyStatusForAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAccessKeyStatusForAccountWithOptions(request, runtime);
}

model UpdatePasswordForAccountRequest {
  newPassword?: string(name='NewPassword'),
  PK?: string(name='PK'),
}

model UpdatePasswordForAccountResponseBody = {
  PK?: string(name='PK'),
  requestId?: string(name='RequestId'),
  result?: string(name='Result'),
}

model UpdatePasswordForAccountResponse = {
  headers: map[string]string(name='headers'),
  body: UpdatePasswordForAccountResponseBody(name='body'),
}

async function updatePasswordForAccountWithOptions(request: UpdatePasswordForAccountRequest, runtime: Util.RuntimeOptions): UpdatePasswordForAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.newPassword)) {
    query['NewPassword'] = request.newPassword;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePasswordForAccount',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updatePasswordForAccount(request: UpdatePasswordForAccountRequest): UpdatePasswordForAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return updatePasswordForAccountWithOptions(request, runtime);
}

model UpdateStatusForAccountRequest {
  accountStatus?: string(name='AccountStatus'),
  changeReason?: string(name='ChangeReason'),
  PK?: string(name='PK'),
}

model UpdateStatusForAccountResponseBody = {
  PK?: string(name='PK'),
  requestId?: string(name='RequestId'),
  result?: string(name='Result'),
}

model UpdateStatusForAccountResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateStatusForAccountResponseBody(name='body'),
}

async function updateStatusForAccountWithOptions(request: UpdateStatusForAccountRequest, runtime: Util.RuntimeOptions): UpdateStatusForAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountStatus)) {
    query['AccountStatus'] = request.accountStatus;
  }
  if (!Util.isUnset(request.changeReason)) {
    query['ChangeReason'] = request.changeReason;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateStatusForAccount',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateStatusForAccount(request: UpdateStatusForAccountRequest): UpdateStatusForAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateStatusForAccountWithOptions(request, runtime);
}

model VerifyAccountLoginTokenRequest {
  loginToken?: string(name='LoginToken'),
}

model VerifyAccountLoginTokenResponseBody = {
  loginToken?: {
    loginTokenString?: string(name='LoginTokenString'),
    targetPk?: string(name='TargetPk'),
  }(name='LoginToken'),
  requestId?: string(name='RequestId'),
}

model VerifyAccountLoginTokenResponse = {
  headers: map[string]string(name='headers'),
  body: VerifyAccountLoginTokenResponseBody(name='body'),
}

async function verifyAccountLoginTokenWithOptions(request: VerifyAccountLoginTokenRequest, runtime: Util.RuntimeOptions): VerifyAccountLoginTokenResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.loginToken)) {
    query['LoginToken'] = request.loginToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VerifyAccountLoginToken',
    version = '2015-07-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function verifyAccountLoginToken(request: VerifyAccountLoginTokenRequest): VerifyAccountLoginTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return verifyAccountLoginTokenWithOptions(request, runtime);
}

